package com.games.portal.rest.model;

import java.util.ArrayList;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "Games")
public class Games {
	
	@XmlElement(name = "Game", type = Game.class)
	private ArrayList<Game> Games;
    
	public ArrayList<Game> getGames() {
		return Games;
	}

	public void setGames(ArrayList<Game> Games) {
		this.Games = Games;
	}
	
	public String toString() {
		StringBuilder sb = new StringBuilder();
		if (Games != null) {
			for (Game game:Games) {
				sb.append(game.getName());
				sb.append("\n");
			}
		}
		return sb.toString();
	}
}
